import { request } from '@/framework/utils/request-jdz';

// 采集标签列表
export const getSamplePrintSearch = (params) => {
  return request(
    {
      url: '/specimens/instance/batch',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 导出Excel文件
export const getExportTemplate = (fields, extFieldIds, formworkId, serial) => {
  return request(
    {
      url: `/specimens/export-template?fields=${fields}&extFieldIds=${extFieldIds}&formworkId=${formworkId}&serials=${serial}`,
      method: 'get',
      responseType: 'blob',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 打印标签
export const postSamplePrint = (params) => {
  return request(
    {
      url: '/specimens/instance/batch',
      method: 'post',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 打印成功
export const putSamplePrintSuccess = (params) => {
  return request(
    {
      url: '/stock/printed',
      method: 'put',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// ecxel上传
export const uploadExcel = (data) => {
  return request(
    {
      url: '/specimens/import',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
//根据储位id拿冰箱id
export const icBoxId = (id) => {
  return request(
    {
      url: `/storages/${id}/parents`,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
//定位导入
export const positionImport = (data) => {
  return request(
    {
      url: `/strain/bind/import`,
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
//出入库盘点设备使用记录
export const postCheck = (data) => {
  return request(
    {
      url: '/device/record',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
